**************************************************
* This program performs the main empirical tests *
* on the marginal value of cash                  *
* reported in Table 4 and robustness tables      *
**************************************************

	clear all
	global path "C:\cow"
	global out "$path\out"
	use "$path\mvc_data.dta"
	set more off

	*Convert strings to numerics
	destring gvkey, gen(firm)	
	encode state, gen(lstateFE)
	encode incorp, gen(istateFE)

	*Generate variables
	egen payout_rd = rowtotal(stock_purchase_rd dividends_rd)
	gen repurchases = stock_purchase_rd/payout_rd	

	gen lag1_cashXd_cash = lag1_cash_rd*d_cash_rd
	gen leverageXd_cash = leverage_mkt*d_cash_rd
	gen repurchasesXd_cash = repurchases*d_cash_rd

	gen ln_mveq_rd = log(mveq_rd)

	*Scale variables by lagged market value of equity (_s) 
	local varlist "d_cash_rd lag1_cash_rd d_earnings_rd d_net_assets_rd d_rd_rd d_interest_exp_rd d_dividends_rd net_financing_rd stock_purchase_rd stock_sale_rd ltdebt_issuance_rd ltdebt_reduction_rd net_debtfinancing_rd lag1_cashXd_cash leverageXd_cash repurchases repurchasesXd_cash"
	foreach v of local varlist {
		gen `v'_s = `v'/lag1_mveq_rd
	}

	drop if fyear < 1996 | fyear > 2018

	*Drop if missing industry
	rename sic sic4
	gen sic3 = floor(sic4/10)
	gen sic2 = floor(sic4/100)
	gen sic1 = floor(sic4/1000)
	drop if missing(sic4)
	*Drop utilities
	drop if sic4 >= 4900 & sic4 <= 4999
	*Drop financials
	drop if sic4 >= 6000 & sic4 <= 6999
	*Drop public administration/non-classifiable firms
	drop if sic4 >= 9000 & sic4 <= 9999

	*Drop if missing headquarter state
	drop if missing(state)
	*Drop if missing state of incorporation
	drop if missing(incorp)
	*Drop if not incorporated in U.S. state
	drop if inlist(incorp, "AS", "INTL", "PR", "TT", "VI")


	*Trim Data
	winsor2 d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s leverage_mkt net_financing_rd_s stock_purchase_rd_s stock_sale_rd_s ltdebt_issuance_rd_s ltdebt_reduction_rd_s net_debtfinancing_rd_s lag1_cashXd_cash_s leverageXd_cash_s repurchases_s repurchasesXd_cash_s, replace cuts(1 99) trim

	*Drop if net assets are negative, the market value of equity is negative, or dividends are negative
	local nonneg "net_assets_rd mveq_rd dividends_rd"
	foreach v of local nonneg {
		drop if `v' < 0
	}

	*Generate treatment variable
	local statelist "DE OK MO KS TX NV NJ MD WA"
	gen treatment = 0
	foreach state of local statelist {
			replace treatment = 1 if incorp == "`state'"
	}


	*Generate COW
		local DE_cow = date("01Jul2000","DMY")
		local OK_cow = date("01Nov2001","DMY")
		local MO_cow = date("01Oct2003","DMY")
		local KS_cow = date("01Jan2005","DMY")
		local TX_cow = date("01Jan2006","DMY")
		local NV_cow = date("01Oct2007","DMY")
		local NJ_cow = date("11Mar2011","DMY")
		local MD_cow = date("01Oct2014","DMY")
		local WA_cow = date("01Jan2016","DMY")
		
		* adjust calendar year of fyeendt to be next year if fyenddt month < cow law date
		gen ayear = year(datadate)
		local statelist "DE OK MO KS TX NV NJ MD WA"
		foreach state of local statelist {
				replace ayear = year(datadate)-1 if incorp == "`state'" & month(datadate) < month(``state'_cow')
				}

		*cow: indicator equal to one if firm is incorporated in a state that has passed a COW law
		gen cow_law = 0
		local statelist "DE OK MO KS TX NV NJ MD WA"
		foreach state of local statelist {
				replace cow_law = 1 if incorp == "`state'" & ayear >= year(``state'_cow')
				}


		*Generate interaction term
		gen cowXcash = cow_law*d_cash_rd_s



	
*********************************
* Table 4 Panel A Summary stats *
*********************************

	estpost tabstat ceoownership cow_law eret eret_ff48 mveq_rd leverage_mkt d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s net_financing_rd_s, statistics (n mean sd p25 p50 p75) columns(statistics)

	distinct gvkey


*******************************
* Table 4 Panel B Regressions *
*******************************

	reghdfe eret d_cash_rd_s cowXcash cow_law , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	*Non-missing Firm Information
	local nonmiss "eret d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s leverage_mkt net_financing_rd_s lag1_cashXd_cash_s leverageXd_cash_s"
	foreach v of local nonmiss {
		drop if missing(`v')
	}

	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	

	
	
	
	
	
	
	
*======================================*
*           ROBUSTNESS TESTS           *
*======================================*
	
		* noncompete index		
		gen nceindex=0
		replace nceindex=5 if incorp=="AL"
		replace nceindex=3 if incorp=="AK"
		replace nceindex=3 if incorp=="AZ"
		replace nceindex=5 if incorp=="AR"
		replace nceindex=0 if incorp=="CA"
		replace nceindex=1 if incorp=="CO"
		replace nceindex=2 if incorp=="CO" & fyear>=1992 
		replace nceindex=3 if incorp=="CO" & fyear>=2012 
		replace nceindex=4 if incorp=="CT"
		replace nceindex=3 if incorp=="CT" & fyear>=1992
		replace nceindex=6 if incorp=="DE"
		replace nceindex=7 if incorp=="DC"
		replace nceindex=7 if incorp=="FL"
		replace nceindex=9 if incorp=="FL" & fyear>=1997
		replace nceindex=5 if incorp=="GA"
		replace nceindex=6 if incorp=="GA" & fyear>=2005
		replace nceindex=7 if incorp=="GA" & fyear>=2011
		replace nceindex=3 if incorp=="HI"
		replace nceindex=4 if incorp=="HI" & fyear>=2007
		replace nceindex=5 if incorp=="ID"
		replace nceindex=6 if incorp=="ID" & fyear>=1992
		replace nceindex=7 if incorp=="ID" & fyear>=2009
		replace nceindex=5 if incorp=="IL"
		replace nceindex=6 if incorp=="IL" & (2012<=fyear<=2013) 
		replace nceindex=5 if incorp=="IN"
		replace nceindex=6 if incorp=="IA"
		replace nceindex=6 if incorp=="KS"
		replace nceindex=7 if incorp=="KS" & fyear>=2008
		replace nceindex=6 if incorp=="KY"
		replace nceindex=5 if incorp=="KY" & fyear>=2015
		replace nceindex=2 if incorp=="LA" & fyear<=1991
		replace nceindex=4 if incorp=="LA" & (1992<=fyear<=2001)
		replace nceindex=4 if incorp=="LA" & (2004<=fyear)
		replace nceindex=4 if incorp=="ME"
		replace nceindex=5 if incorp=="MD"
		replace nceindex=6 if incorp=="MA"
		replace nceindex=5 if incorp=="MI"
		replace nceindex=5 if incorp=="MN"
		replace nceindex=4 if incorp=="MS"
		replace nceindex=5 if incorp=="MS" & fyear>=2009
		replace nceindex=7 if incorp=="MO"
		replace nceindex=2 if incorp=="MT"
		replace nceindex=4 if incorp=="NE"
		replace nceindex=5 if incorp=="NV"
		replace nceindex=2 if incorp=="NH"
		replace nceindex=1 if incorp=="NH" & fyear>=2013
		replace nceindex=4 if incorp=="NJ"
		replace nceindex=2 if incorp=="NM"
		replace nceindex=3 if incorp=="NY"
		replace nceindex=4 if incorp=="NC"
		replace nceindex=0 if incorp=="ND"
		replace nceindex=4 if incorp=="OH"
		replace nceindex=5 if incorp=="OH" & fyear>=1992
		replace nceindex=6 if incorp=="OH" & fyear>=2005
		replace nceindex=1 if incorp=="OK"
		replace nceindex=6 if incorp=="OR"
		replace nceindex=5 if incorp=="OR" & fyear>=2008
		replace nceindex=6 if incorp=="PA"
		replace nceindex=3 if incorp=="RI"
		replace nceindex=5 if incorp=="SC"
		replace nceindex=4 if incorp=="SC" & fyear>=2011
		replace nceindex=5 if incorp=="SD"
		replace nceindex=7 if incorp=="TN"
		replace nceindex=5 if incorp=="TX"
		replace nceindex=3 if incorp=="TX" & fyear>=1995
		replace nceindex=4 if incorp=="TX" & fyear>=2011
		replace nceindex=6 if incorp=="UT"
		replace nceindex=5 if incorp=="VT"
		replace nceindex=6 if incorp=="VT" & fyear>=2006
		replace nceindex=4 if incorp=="VA" & (1980<=fyear<=1991)
		replace nceindex=3 if incorp=="VA" & (1992<=fyear<=2005)
		replace nceindex=4 if incorp=="VA" & (2006<=fyear<=2013)
		replace nceindex=5 if incorp=="VA" & (2014<=fyear)
		replace nceindex=5 if incorp=="WA"
		replace nceindex=2 if incorp=="WV" 
		replace nceindex=3 if incorp=="WV" & (1984<=fyear<=1991)
		replace nceindex=3 if incorp=="WI"
		replace nceindex=4 if incorp=="WI" & fyear>=2010
		replace nceindex=5 if incorp=="WI" & fyear>=2016
		replace nceindex=4 if incorp=="WY"

		* universal demand law
		gen ud=0
		replace ud=1 if incorp=="UT" & fyear>=1992
		replace ud=1 if incorp=="NH" & fyear>=1993
		replace ud=1 if incorp=="MS" & fyear>=1993
		replace ud=1 if incorp=="NC" & fyear>=1995
		replace ud=1 if incorp=="AZ" & fyear>=1996
		replace ud=1 if incorp=="NE" & fyear>=1996
		replace ud=1 if incorp=="CT" & fyear>=1997
		replace ud=1 if incorp=="ME" & fyear>=1997
		replace ud=1 if incorp=="PA" & fyear>=1997
		replace ud=1 if incorp=="TX" & fyear>=1997
		replace ud=1 if incorp=="WY" & fyear>=1997
		replace ud=1 if incorp=="ID" & fyear>=1998
		replace ud=1 if incorp=="HI" & fyear>=2001
		replace ud=1 if incorp=="IA" & fyear>=2003
		replace ud=1 if incorp=="MA" & fyear>=2004
		replace ud=1 if incorp=="RI" & fyear>=2005
		replace ud=1 if incorp=="SD" & fyear>=2005
		
		* The five most common types of antitakeover laws adopted by states since 1982. The law types are: control share acquisition laws (CS), business combination laws (BC), fair price laws (FP), directors' duties laws (DD), and poison pill laws (PP)
 
		* cs law
		gen cs=0
		replace cs =1 if incorp=="AZ" & fyear>=1987
		replace cs =1 if incorp=="FL" & fyear>=1987
		replace cs =1 if incorp=="HI" & fyear>=1985
		replace cs =1 if incorp=="ID" & fyear>=1988
		replace cs =1 if incorp=="IN" & fyear>=1986
		replace cs =1 if incorp=="KS" & fyear>=1988
		replace cs =1 if incorp=="LA" & fyear>=1987
		replace cs =1 if incorp=="MD" & fyear>=1989
		replace cs =1 if incorp=="MA" & fyear>=1987
		replace cs =1 if incorp=="MI" & fyear>=1988
		replace cs =1 if incorp=="MN" & fyear>=1984
		replace cs =1 if incorp=="MS" & fyear>=1990
		replace cs =1 if incorp=="MO" & fyear>=1984
		replace cs =1 if incorp=="NE" & fyear>=1988
		replace cs =1 if incorp=="NV" & fyear>=1987
		replace cs =1 if incorp=="NC" & fyear>=1987
		replace cs =1 if incorp=="OH" & fyear>=1982
		replace cs =1 if incorp=="OK" & fyear>=1987
		replace cs =1 if incorp=="OR" & fyear>=1987
		replace cs =1 if incorp=="PA" & fyear>=1990
		replace cs =1 if incorp=="SC" & fyear>=1988
		replace cs =1 if incorp=="SD" & fyear>=1990
		replace cs =1 if incorp=="TN" & fyear>=1988
		replace cs =1 if incorp=="UT" & fyear>=1987
		replace cs =1 if incorp=="VA" & fyear>=1989
		replace cs =1 if incorp=="WI" & fyear>=1984
		replace cs =1 if incorp=="WY" & fyear>=1990

		* bc law
		gen bc=0
		replace bc =1 if incorp=="AZ" & fyear>=1987
		replace bc =1 if incorp=="CT" & fyear>=1988
		replace bc =1 if incorp=="DE" & fyear>=1988
		replace bc =1 if incorp=="GA" & fyear>=1988
		replace bc =1 if incorp=="ID" & fyear>=1988
		replace bc =1 if incorp=="IL" & fyear>=1989
		replace bc =1 if incorp=="IN" & fyear>=1986
		replace bc =1 if incorp=="IA" & fyear>=1997
		replace bc =1 if incorp=="KS" & fyear>=1989
		replace bc =1 if incorp=="KY" & fyear>=1986
		replace bc =1 if incorp=="ME" & fyear>=1988
		replace bc =1 if incorp=="MD" & fyear>=1989
		replace bc =1 if incorp=="MA" & fyear>=1989
		replace bc =1 if incorp=="MI" & fyear>=1989
		replace bc =1 if incorp=="MN" & fyear>=1987
		replace bc =1 if incorp=="MO" & fyear>=1986
		replace bc =1 if incorp=="NE" & fyear>=1988
		replace bc =1 if incorp=="NV" & fyear>=1991
		replace bc =1 if incorp=="NJ" & fyear>=1986
		replace bc =1 if incorp=="NY" & fyear>=1985
		replace bc =1 if incorp=="OH" & fyear>=1990
		replace bc =1 if incorp=="OK" & fyear>=1991
		replace bc =1 if incorp=="OR" & fyear>=1991
		replace bc =1 if incorp=="PA" & fyear>=1988
		replace bc =1 if incorp=="RI" & fyear>=1990
		replace bc =1 if incorp=="SC" & fyear>=1988
		replace bc =1 if incorp=="SD" & fyear>=1990
		replace bc =1 if incorp=="TN" & fyear>=1988
		replace bc =1 if incorp=="TX" & fyear>=1997
		replace bc =1 if incorp=="VA" & fyear>=1988
		replace bc =1 if incorp=="WA" & fyear>=1987
		replace bc =1 if incorp=="WI" & fyear>=1987
		replace bc =1 if incorp=="WY" & fyear>=1989

		* fp law
		gen fp=0
		replace fp =1 if incorp=="AZ" & fyear>=1987
		replace fp =1 if incorp=="CT" & fyear>=1984
		replace fp =1 if incorp=="FL" & fyear>=1987
		replace fp =1 if incorp=="GA" & fyear>=1985
		replace fp =1 if incorp=="ID" & fyear>=1988
		replace fp =1 if incorp=="IL" & fyear>=1985
		replace fp =1 if incorp=="IN" & fyear>=1986
		replace fp =1 if incorp=="KY" & fyear>=1984
		replace fp =1 if incorp=="LA" & fyear>=1984
		replace fp =1 if incorp=="MD" & fyear>=1983
		replace fp =1 if incorp=="MI" & fyear>=1984
		replace fp =1 if incorp=="MN" & fyear>=1991
		replace fp =1 if incorp=="MS" & fyear>=1985
		replace fp =1 if incorp=="MO" & fyear>=1986
		replace fp =1 if incorp=="NV" & fyear>=1991
		replace fp =1 if incorp=="NJ" & fyear>=1986
		replace fp =1 if incorp=="NY" & fyear>=1985
		replace fp =1 if incorp=="NC" & fyear>=1987
		replace fp =1 if incorp=="OH" & fyear>=1990
		replace fp =1 if incorp=="PA" & fyear>=1988
		replace fp =1 if incorp=="RI" & fyear>=1990
		replace fp =1 if incorp=="SC" & fyear>=1988
		replace fp =1 if incorp=="SD" & fyear>=1990
		replace fp =1 if incorp=="TN" & fyear>=1988
		replace fp =1 if incorp=="VA" & fyear>=1985
		replace fp =1 if incorp=="WA" & fyear>=1985
		replace fp =1 if incorp=="WI" & fyear>=1984

		* dd law
		gen dd=0
		replace dd =1 if incorp=="AZ" & fyear>=1987
		replace dd =1 if incorp=="CT" & fyear>=1988
		replace dd =1 if incorp=="FL" & fyear>=1989
		replace dd =1 if incorp=="GA" & fyear>=1989
		replace dd =1 if incorp=="HI" & fyear>=1989
		replace dd =1 if incorp=="ID" & fyear>=1988
		replace dd =1 if incorp=="IL" & fyear>=1985
		replace dd =1 if incorp=="IN" & fyear>=1986
		replace dd =1 if incorp=="IA" & fyear>=1989
		replace dd =1 if incorp=="KY" & fyear>=1988
		replace dd =1 if incorp=="LA" & fyear>=1988
		replace dd =1 if incorp=="ME" & fyear>=1985
		replace dd =1 if incorp=="MD" & fyear>=1999
		replace dd =1 if incorp=="MA" & fyear>=1989
		replace dd =1 if incorp=="MN" & fyear>=1987
		replace dd =1 if incorp=="MS" & fyear>=1990
		replace dd =1 if incorp=="MO" & fyear>=1986
		replace dd =1 if incorp=="NE" & fyear>=1988
		replace dd =1 if incorp=="NV" & fyear>=1991
		replace dd =1 if incorp=="NJ" & fyear>=1989
		replace dd =1 if incorp=="NM" & fyear>=1987
		replace dd =1 if incorp=="NY" & fyear>=1987
		replace dd =1 if incorp=="NC" & fyear>=1993
		replace dd =1 if incorp=="ND" & fyear>=1993
		replace dd =1 if incorp=="OH" & fyear>=1984
		replace dd =1 if incorp=="OR" & fyear>=1989
		replace dd =1 if incorp=="PA" & fyear>=1990
		replace dd =1 if incorp=="RI" & fyear>=1990
		replace dd =1 if incorp=="SD" & fyear>=1990
		replace dd =1 if incorp=="TN" & fyear>=1988
		replace dd =1 if incorp=="TX" & fyear>=2003
		replace dd =1 if incorp=="VT" & fyear>=1998
		replace dd =1 if incorp=="VA" & fyear>=1988
		replace dd =1 if incorp=="WI" & fyear>=1987
		replace dd =1 if incorp=="WY" & fyear>=1990

		* pp law
		gen pp=0
		replace pp =1 if incorp=="CO" & fyear>=1989
		replace pp =1 if incorp=="CT" & fyear>=2003
		replace pp =1 if incorp=="FL" & fyear>=1989
		replace pp =1 if incorp=="GA" & fyear>=1988
		replace pp =1 if incorp=="HI" & fyear>=1988
		replace pp =1 if incorp=="ID" & fyear>=1988
		replace pp =1 if incorp=="IL" & fyear>=1989
		replace pp =1 if incorp=="IN" & fyear>=1986
		replace pp =1 if incorp=="IA" & fyear>=1989
		replace pp =1 if incorp=="KY" & fyear>=1988
		replace pp =1 if incorp=="ME" & fyear>=2002
		replace pp =1 if incorp=="MD" & fyear>=1999
		replace pp =1 if incorp=="MA" & fyear>=1989
		replace pp =1 if incorp=="MI" & fyear>=2001
		replace pp =1 if incorp=="MN" & fyear>=1995
		replace pp =1 if incorp=="MS" & fyear>=2005
		replace pp =1 if incorp=="MO" & fyear>=1999
		replace pp =1 if incorp=="NV" & fyear>=1989
		replace pp =1 if incorp=="NJ" & fyear>=1989
		replace pp =1 if incorp=="NY" & fyear>=1988
		replace pp =1 if incorp=="NC" & fyear>=1989
		replace pp =1 if incorp=="OH" & fyear>=1986
		replace pp =1 if incorp=="OR" & fyear>=1989
		replace pp =1 if incorp=="PA" & fyear>=1988
		replace pp =1 if incorp=="RI" & fyear>=1990
		replace pp =1 if incorp=="SC" & fyear>=1998
		replace pp =1 if incorp=="SD" & fyear>=1990
		replace pp =1 if incorp=="TN" & fyear>=1989
		replace pp =1 if incorp=="TX" & fyear>=2003
		replace pp =1 if incorp=="UT" & fyear>=1989
		replace pp =1 if incorp=="VT" & fyear>=2008
		replace pp =1 if incorp=="VA" & fyear>=1990
		replace pp =1 if incorp=="WA" & fyear>=1998
		replace pp =1 if incorp=="WI" & fyear>=1987
		replace pp =1 if incorp=="WY" & fyear>=2009

		* Revlon case
		gen revlon=0
		replace revlon =1 if incorp=="CA" & fyear>=2002
		replace revlon =1 if incorp=="DE" & fyear>=1986
		replace revlon =1 if incorp=="IL" & fyear>=1988
		replace revlon =1 if incorp=="IN" & fyear>=1987
		replace revlon =-1 if incorp=="IN" & fyear>=2001
		replace revlon =1 if incorp=="KS" & fyear>=2003
		replace revlon =-1 if incorp=="MD" & fyear>=2004
		replace revlon =1 if incorp=="MD" & fyear>=2009
		replace revlon =1 if incorp=="MI" & fyear>=1986
		replace revlon =1 if incorp=="MN" & fyear>=1987
		replace revlon =1 if incorp=="MO" & fyear>=1999
		replace revlon =1 if incorp=="NV" & fyear>=1997
		replace revlon =-1 if incorp=="NV" & fyear>=1999
		replace revlon =1 if incorp=="NH" & fyear>=2001
		replace revlon =1 if incorp=="NY" & fyear>=1986
		replace revlon =-1 if incorp=="NY" & fyear>=1997
		replace revlon =-1 if incorp=="NC" & fyear>=2001
		replace revlon =-1 if incorp=="OH" & fyear>=1990
		replace revlon =-1 if incorp=="PA" & fyear>=1987
		replace revlon =-1 if incorp=="VA" & fyear>=1999
		replace revlon =-1 if incorp=="WI" & fyear>=1999
		
		* Unocal case
		gen unocal=0
		replace unocal =1 if incorp=="AR" & fyear>=1993
		replace unocal =1 if incorp=="CA" & fyear>=1989
		replace unocal =1 if incorp=="DE" & fyear>=1985
		replace unocal =1 if incorp=="CA" & fyear>=2002
		replace unocal =1 if incorp=="FL" & fyear>=1989
		replace unocal =1 if incorp=="IL" & fyear>=1988
		replace unocal =1 if incorp=="IN" & fyear>=1987
		replace unocal =-1 if incorp=="IN" & fyear>=2001
		replace unocal =1 if incorp=="KS" & fyear>=2003
		replace unocal =-1 if incorp=="MD" & fyear>=1988
		replace unocal =1 if incorp=="MD" & fyear>=2004
		replace unocal =-1 if incorp=="MA" & fyear>=2003
		replace unocal =1 if incorp=="MI" & fyear>=1986
		replace unocal =1 if incorp=="MN" & fyear>=1987
		replace unocal =1 if incorp=="MO" & fyear>=1999
		replace unocal =-1 if incorp=="NV" & fyear>=1985
		replace unocal =-1 if incorp=="NJ" & fyear>=1998
		replace unocal =-1 if incorp=="NY" & fyear>=1986
		replace unocal =-1 if incorp=="NC" & fyear>=2001
		replace unocal =-1 if incorp=="OH" & fyear>=1986
		replace unocal =-1 if incorp=="PA" & fyear>=1986
		replace unocal =1 if incorp=="TX" & fyear>=1989
		replace unocal =-1 if incorp=="VA" & fyear>=1995
		replace unocal =1 if incorp=="WI" & fyear>=1989

		* Blasius case
		gen blasius=0
		replace blasius =1 if incorp=="CT" & fyear>=2000
		replace blasius =1 if incorp=="DE" & fyear>=1988
		replace blasius =-1 if incorp=="GA" & fyear>=1997
		replace blasius =-1 if incorp=="IN" & fyear>=1993
		replace blasius =-1 if incorp=="IN" & fyear>=2001
		replace blasius =1 if incorp=="KS" & fyear>=2003
		replace blasius =-1 if incorp=="MD" & fyear>=1999
		replace blasius =1 if incorp=="MD" & fyear>=2005
		replace blasius =1 if incorp=="MA" & fyear>=1990
		replace blasius =1 if incorp=="MI" & fyear>=2003
		replace blasius =1 if incorp=="NV" & fyear>=1997
		replace blasius =-1 if incorp=="NV" & fyear>=1999
		replace blasius =-1 if incorp=="NJ" & fyear>=1998
		replace blasius =-1 if incorp=="NC" & fyear>=1984
		replace blasius =-1 if incorp=="OH" & fyear>=1986
		replace blasius =-1 if incorp=="PA" & fyear>=1990
		replace blasius =-1 if incorp=="VA" & fyear>=1986
		
		* Madatory classified board law
		gen mcb=0
		replace mcb =1 if incorp=="IN" & fyear>=2009
		replace mcb =1 if incorp=="IA" & fyear>=2011
		replace mcb =-1 if incorp=="IA" & fyear>=2014
		replace mcb =1 if incorp=="MA" & fyear>=1990
		replace mcb =1 if incorp=="OK" & fyear>=2010
		replace mcb =-1 if incorp=="OK" & fyear>=2013
		
	
	
********************************
* Table 7 Managerial ownership *
********************************
		
	reghdfe eret c.d_cash_rd_s##c.ceoownership c.cowXcash##c.ceoownership cow_law##c.ceoownership lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s   , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 c.d_cash_rd_s##c.ceoownership c.cowXcash##c.ceoownership cow_law##c.ceoownership  lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s  , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	
*********************************
* Table 8 Independent directors *
*********************************

	reghdfe eret c.d_cash_rd_s##c.pct_inddir c.cowXcash##c.pct_inddir cow_law##c.pct_inddir lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s   , absorb(firm lstate#fyear sic4#fyear) vce(cluster istate)
	reghdfe eret_ff48 c.d_cash_rd_s##c.pct_inddir c.cowXcash##c.pct_inddir cow_law##c.pct_inddir  lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s  , absorb(firm lstate#fyear sic4#fyear) vce(cluster istate)
	

************************************
* Table 10 HQ state = Incorp state *
************************************

	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s cbdefml ceoownership activeownership5 div busseg cown_mean  if incorp==state , absorb(firm sic4 fyear) vce(cluster istate) 
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s if incorp==state , absorb(firm sic4#fyear) vce(cluster istate)

	
**************************	
* Table 11 Drop DE firms *
**************************	

	reghdfe eret d_cash_rd_s cowXcash cow_law if state~="DE", absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s if state~="DE" , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
 
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law if state~="DE" , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s if state~="DE" , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	
*************************************
* Table 12 Additional firm controls *
*************************************

		local control "ceoownership div busseg activeownership5 activeownership "
		foreach v of local control {
		replace `v'=0 if missing(`v') 
		}

	reghdfe eret d_cash_rd_s cowXcash cow_law cbdefml ceoownership activeownership5 div busseg cown_mean lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s  , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law cbdefml ceoownership activeownership5 div busseg cown_mean lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	
**************************************
* Table 13 Additional legal controls *
**************************************
	
	reghdfe eret d_cash_rd_s cowXcash cow_law nceindex ud mcb cs bc fp dd pp revlon unocal blasius lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s  , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law nceindex ud mcb cs bc fp dd pp revlon unocal blasius lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)


*******************************************	
* Table 14 High dimensional fixed effects *
*******************************************	

	winsor2 eret, replace cuts(0.5 99.5) trim
	reghdfe eret d_cash_rd_s cowXcash cow_law , absorb(firm lstate#sic1#fyear) vce(cluster istate)
	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s , absorb(firm lstate#sic1#fyear) vce(cluster istate)
 
	winsor2 eret_ff48, replace cuts(0.5 99.5) trim
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law, absorb(firm lstate#sic1#fyear) vce(robust)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s , absorb(firm lstate#sic1#fyear) vce(cluster istate)

	
************************
* Table 15 Matched DiD *
************************
		
		local control "ceoownership div busseg activeownership5 activeownership cown_mean "
		foreach v of local control {
		replace `v'=0 if missing(`v') 
		}
		
	psmatch2 treatment ln_mveq_rd leverage_mkt  cbdefml ceoownership activeownership5 div busseg cown_mean i.lstateFE i.fyear i.sic2, n(1)		
	bys permno: egen matching_sample = sum(_weight)
	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s if matching_sample!=0, absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s if matching_sample!=0, absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

		
************************
* Table 16 Stacked DiD *
************************

		expand 2, gen(event_DE)
		drop if event_DE==1 & treatment==1 & incorp~="DE" 
		drop if event_DE==1 & (ayear<1996 | ayear>2004)

		expand 2 if event_DE==0, gen(event_OK)
		drop if event_OK==1 & treatment==1 & incorp~="OK"
		drop if event_OK==1 & (ayear<1997 | ayear>2005)

		expand 2 if event_DE==0 & event_OK==0, gen(event_MO)
		drop if event_MO==1 & treatment==1 & incorp~="MO"
		drop if event_MO==1 & (ayear<1999 | ayear>2007)
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0, gen(event_KS)
		drop if event_KS==1 & treatment==1 & incorp~="KS"
		drop if event_KS==1 & (ayear<2001 | ayear>2009)
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0, gen(event_TX)
		drop if event_TX==1 & treatment==1 & incorp~="TX"
		drop if event_TX==1 & (ayear<2002 | ayear>2010)
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0 & event_TX==0, gen(event_NV)
		drop if event_NV==1 & treatment==1 & incorp~="NV"
		drop if event_NV==1 & (ayear<2003 | ayear>2011)
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0 & event_TX==0 & event_NV==0, gen(event_NJ)
		drop if event_NJ==1 & treatment==1 & incorp~="NJ"
		drop if event_NJ==1 & (ayear<2007 | ayear>2015)
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0 & event_TX==0 & event_NV==0 & event_NJ==0, gen(event_MD)
		drop if event_MD==1 & treatment==1 & incorp~="MD"
		drop if event_MD==1 & (ayear<2010 | ayear>2018) 
		
		expand 2 if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0 & event_TX==0 & event_NV==0 & event_NJ==0 & event_MD==0, gen(event_WA)
		drop if event_WA==1 & treatment==1 & incorp~="WA"
		drop if event_WA==1 & (ayear<2012 | ayear>2020)
		
		drop if event_DE==0 & event_OK==0 & event_MO==0 & event_KS==0 & event_TX==0 & event_NV==0 & event_NJ==0 & event_MD==0 & event_WA==0
				
	reghdfe eret d_cash_rd_s cowXcash cow_law d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
	reghdfe eret_ff48 d_cash_rd_s cowXcash cow_law  d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	
	
********************************
* Table B3 Dynamic coeff trend *
********************************

	clear all
	global path "C:\cow"
	global out "$path\out"
	use "$path\mvc_data.dta"
	set more off

	*Convert strings to numerics
	destring gvkey, gen(firm)	
	encode state, gen(lstateFE)
	encode incorp, gen(istateFE)

	*Generate variables
	egen payout_rd = rowtotal(stock_purchase_rd dividends_rd)
	gen repurchases = stock_purchase_rd/payout_rd	

	gen lag1_cashXd_cash = lag1_cash_rd*d_cash_rd
	gen leverageXd_cash = leverage_mkt*d_cash_rd
	gen repurchasesXd_cash = repurchases*d_cash_rd

	gen ln_mveq_rd = log(mveq_rd)

	*Scale variables by lagged market value of equity (_s) 
	local varlist "d_cash_rd lag1_cash_rd d_earnings_rd d_net_assets_rd d_rd_rd d_interest_exp_rd d_dividends_rd net_financing_rd stock_purchase_rd stock_sale_rd ltdebt_issuance_rd ltdebt_reduction_rd net_debtfinancing_rd lag1_cashXd_cash leverageXd_cash repurchases repurchasesXd_cash"
	foreach v of local varlist {
		gen `v'_s = `v'/lag1_mveq_rd
	}

	drop if fyear < 1996 | fyear > 2018

	*Drop if missing industry
	rename sic sic4
	gen sic3 = floor(sic4/10)
	gen sic2 = floor(sic4/100)
	gen sic1 = floor(sic4/1000)
	drop if missing(sic4)
	*Drop utilities
	drop if sic4 >= 4900 & sic4 <= 4999
	*Drop financials
	drop if sic4 >= 6000 & sic4 <= 6999
	*Drop public administration/non-classifiable firms
	drop if sic4 >= 9000 & sic4 <= 9999

	*Drop if missing headquarter state
	drop if missing(state)
	*Drop if missing state of incorporation
	drop if missing(incorp)
	*Drop if not incorporated in U.S. state
	drop if inlist(incorp, "AS", "INTL", "PR", "TT", "VI")


	*Trim Data
	winsor2 d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s leverage_mkt net_financing_rd_s stock_purchase_rd_s stock_sale_rd_s ltdebt_issuance_rd_s ltdebt_reduction_rd_s net_debtfinancing_rd_s lag1_cashXd_cash_s leverageXd_cash_s repurchases_s repurchasesXd_cash_s, replace cuts(1 99) trim

	*Drop if net assets are negative, the market value of equity is negative, or dividends are negative
	local nonneg "net_assets_rd mveq_rd dividends_rd"
	foreach v of local nonneg {
		drop if `v' < 0
	}

	*Generate treatment variable
	local statelist "DE OK MO KS TX NV NJ MD WA"
	gen treatment = 0
	foreach state of local statelist {
			replace treatment = 1 if incorp == "`state'"
	}


	*Generate COW
		local DE_cow = date("01Jul2000","DMY")
		local OK_cow = date("01Nov2001","DMY")
		local MO_cow = date("01Oct2003","DMY")
		local KS_cow = date("01Jan2005","DMY")
		local TX_cow = date("01Jan2006","DMY")
		local NV_cow = date("01Oct2007","DMY")
		local NJ_cow = date("11Mar2011","DMY")
		local MD_cow = date("01Oct2014","DMY")
		local WA_cow = date("01Jan2016","DMY")
		
		* adjust calendar year of fyeendt to be next year if fyenddt month < cow law date
		gen ayear = year(datadate)
		local statelist "DE OK MO KS TX NV NJ MD WA"
		foreach state of local statelist {
				replace ayear = year(datadate)-1 if incorp == "`state'" & month(datadate) < month(``state'_cow')
				}

		*cow: indicator equal to one if firm is incorporated in a state that has passed a COW law
		gen cow_law = 0
		local statelist "DE OK MO KS TX NV NJ MD WA"
		foreach state of local statelist {
				replace cow_law = 1 if incorp == "`state'" & ayear >= year(``state'_cow')
				}

	gen cowXlev = cow_law*leverage_mkt 
	gen cashXlev = cow_law*leverage_mkt 
	gen d_cash_rd_sXleverage_mkt=d_cash_rd_s*leverage_mkt

		*Initialize variables
		forval x=1/25 {
			gen cow_lawn`x'=0
			}

		forval x=0/25 {
			gen cow_law`x'=0
			}


		gen cow_law2p = 0
		gen cow_law3p = 0
		gen cow_law4p = 0

		*Generate event time dummies
		foreach state of local statelist {
			forval x=1/25 {
			replace cow_lawn`x' = 1 if incorp == "`state'" & ayear == year(``state'_cow')-`x'
			}
			}	
			
		foreach state of local statelist {
			forval x=0/25 {
			replace cow_law`x' = 1 if incorp == "`state'" & ayear == year(``state'_cow')+`x'
			}
			}
			
		foreach state of local statelist {
			replace cow_law2p = 1 if incorp == "`state'" & ayear >= year(``state'_cow')+2
			replace cow_law3p = 1 if incorp == "`state'" & ayear >= year(``state'_cow')+3
			replace cow_law4p = 1 if incorp == "`state'" & ayear >= year(``state'_cow')+4
			}

		*Generate interaction terms (Xcash) 
		forval x=1/25 {
			gen cow_lawn`x'Xcash = cow_lawn`x'*d_cash_rd_s
			}

		forval x=0/25 {
			gen cow_law`x'Xcash = cow_law`x'*d_cash_rd_s
			}

		gen cow_law2pXcash = cow_law2p*d_cash_rd_s
		gen cow_law3pXcash = cow_law3p*d_cash_rd_s
		gen cow_law4pXcash = cow_law4p*d_cash_rd_s


		gen eretXcow= eret*cow_law
		gen levXcow= leverage_mkt * cow_law
		
	reghdfe eret lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s d_cash_rd_s  cow_lawn2Xcash cow_lawn1Xcash cow_law0Xcash cow_law1Xcash cow_law2Xcash cow_law3pXcash  cow_lawn2 cow_lawn1 cow_law0 cow_law1 cow_law2 cow_law3p, absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)

	reghdfe eret_ff48 lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s  leverage_mkt net_financing_rd_s d_cash_rd_s  cow_lawn2Xcash cow_lawn1Xcash cow_law0Xcash cow_law1Xcash cow_law2Xcash cow_law3pXcash  cow_lawn2 cow_lawn1 cow_law0 cow_law1 cow_law2 cow_law3p, absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
		

*******************************
* Figure B2 Block permutation *
*******************************

	clear all
	global path "C:\cow"
	global out "$path\out"
	use "$path\mvc_data.dta"
	set more off

	destring gvkey, gen(firm)	
	encode state, gen(lstateFE)
	encode incorp, gen(istateFE)

	egen payout_rd = rowtotal(stock_purchase_rd dividends_rd)
	gen repurchases = stock_purchase_rd/payout_rd	

	gen lag1_cashXd_cash = lag1_cash_rd*d_cash_rd
	gen leverageXd_cash = leverage_mkt*d_cash_rd
	gen repurchasesXd_cash = repurchases*d_cash_rd

	gen ln_mveq_rd = log(mveq_rd)

	local varlist "d_cash_rd lag1_cash_rd d_earnings_rd d_net_assets_rd d_rd_rd d_interest_exp_rd d_dividends_rd net_financing_rd stock_purchase_rd stock_sale_rd ltdebt_issuance_rd ltdebt_reduction_rd net_debtfinancing_rd lag1_cashXd_cash leverageXd_cash repurchases repurchasesXd_cash"
	foreach v of local varlist {
		gen `v'_s = `v'/lag1_mveq_rd
	}

	drop if fyear < 1996 | fyear > 2018
	rename sic sic4
	gen sic3 = floor(sic4/10)
	gen sic2 = floor(sic4/100)
	gen sic1 = floor(sic4/1000)
	drop if missing(sic4)
	drop if sic4 >= 4900 & sic4 <= 4999
	drop if sic4 >= 6000 & sic4 <= 6999
	drop if sic4 >= 9000 & sic4 <= 9999
	drop if missing(state)
	drop if missing(incorp)
	drop if inlist(incorp, "AS", "INTL", "PR", "TT", "VI")

	winsor2 eret_ff48 d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s leverage_mkt net_financing_rd_s stock_purchase_rd_s stock_sale_rd_s ltdebt_issuance_rd_s ltdebt_reduction_rd_s net_debtfinancing_rd_s lag1_cashXd_cash_s leverageXd_cash_s repurchases_s repurchasesXd_cash_s, replace cuts(1 99) trim

	local nonneg "net_assets_rd mveq_rd dividends_rd"
	foreach v of local nonneg {
		drop if `v' < 0
	}
	local nonmiss "eret_ff48 d_cash_rd_s lag1_cash_rd_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s leverage_mkt net_financing_rd_s lag1_cashXd_cash_s leverageXd_cash_s"
	foreach v of local nonmiss {
		drop if missing(`v')
	}

	* Loop 1000;

		forval y= 1/1000 {
		bysort incorp_no: gen ryear_`y' = runiformint(1996,2018)
		bysort incorp_no: replace ryear_`y' = ryear_`y'[1]
		bysort incorp_no: gen treatment_`y' = runiformint(0,1)
		bysort incorp_no: replace treatment_`y' = treatment_`y'[1]
		gen cow_`y' =0
		replace cow_`y' =1 if treatment_`y'==1 & fyear >= ryear_`y'
		gen cashcow_`y'=d_cash_rd_s*cow_`y'
		quietly reghdfe eret_ff48 cashcow_`y' cow_`y' d_cash_rd_s lag1_cashXd_cash_s leverageXd_cash_s d_earnings_rd_s d_net_assets_rd_s d_rd_rd_s d_interest_exp_rd_s d_dividends_rd_s lag1_cash_rd_s leverage_mkt net_financing_rd_s   , absorb(firm lstate#fyear sic3#fyear) vce(cluster istate)
		estimate store m`y'
		drop ryear_`y' treatment_`y' cow_`y' cashcow_`y'
		}

		estout m* using "cash_loop_ff1.csv", cells(b) replace
		

